package yt.kpool.adapter;

import android.app.Activity;
import android.content.ClipboardManager;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

import com.king.base.adapter.ViewHolderAdapter;
import com.king.base.adapter.holder.ViewHolder;

import java.util.List;

import yt.kpool.R;
import yt.kpool.activity.personal.FastLookUserDetailActivity;
import yt.kpool.bean.AddMinerRemarkBean;
import yt.kpool.bean.FastLookAccountBean;
import yt.kpool.util.ToastUtil;

import static android.content.Context.CLIPBOARD_SERVICE;

/**
 * 快速查看列表
 * Created by Administrator on 2017/8/7.
 */

public class FastLookListAdapter extends ViewHolderAdapter<FastLookAccountBean> {

    private int selectPos=-1;

    public FastLookListAdapter(Context context, List<FastLookAccountBean> listData) {
        super(context, listData);
    }

    @Override
    public View buildConvertView(LayoutInflater layoutInflater, FastLookAccountBean fastLookAccountBean, int position) {
        return layoutInflater.inflate(R.layout.item_fastlook_layout,null);
    }

    @Override
    public void bindViewDatas(ViewHolder holder, final FastLookAccountBean fastLookAccountBean, int position) {


        holder.setText(R.id.tv_content,fastLookAccountBean.getName()+"(只读页面)");

        if (position==selectPos)
        {
            holder.getView(R.id.ll_bg).setBackgroundResource(R.drawable.fastlook_circle_white_selected_bg);
        }else
        {
            holder.getView(R.id.ll_bg).setBackgroundResource(R.drawable.fastlook_circle_white_bg);
        }

        holder.getView(R.id.iv_more).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                FastLookUserDetailActivity.start((Activity) context,fastLookAccountBean.getName(),fastLookAccountBean.getRemark(),fastLookAccountBean.getLink());
            }
        });
    }

    public int getSelectPos() {
        return selectPos;
    }

    public void setSelectPos(int selectPos) {
        this.selectPos = selectPos;
    }
}
